#ifndef _LINESFOLLOWMOUSECLICK_H_
#define _LINESFOLLOWMOUSECLICK_H_

#pragma once
#include "SDL.h"
#include "..\SDLSample.h"
#include <list>
#include <iostream>

using namespace std;

class LinesFollowMouseClick : public SDLSample
{
public:
	LinesFollowMouseClick(void);
	virtual ~LinesFollowMouseClick(void);
	void run(void);
private:
	void drawLine(int, int, int, int, Uint32);
	int absoluteValue(int);
	int round(float);
	void putPixel(int, int, Uint32);
	SDL_Surface* screen;
	class Point
	{
	public:
		Point(int, int);
		~Point(void);
		int getX(void);
		int getY(void);
		bool equals(Point*, int);
		int absoluteValue(int);
	private:
		int xpos;
		int ypos;
	};
	list<Point*> points;
	bool polygonClosed;
	static int WINDOW_WIDTH;
	static int WINDOW_HEIGHT;
};

#endif
